package com.xm.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xm.mapper.MemberEssentialinfoMapper;
import com.xm.pojo.*;
import com.xm.service.MemberEssentialinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MemberEssentialinfoServiceImpl implements MemberEssentialinfoService {
    @Autowired
    MemberEssentialinfoMapper mapper;

    public int insertMemberinfoService(Memberinfo memberinfo) {
        return mapper.insertMemberinfo(memberinfo);
    }

    public int insertMemberfilesService(Memberfiles memberfiles) {
        return mapper.insertMemberfiles(memberfiles);
    }

    public int insertMemberDynamicinfoService(MemberDynamicinfo memberDynamicinfo) {
        return mapper.insertMemberDynamicinfo(memberDynamicinfo);
    }

    public int insertMemberMedicalhistoryService(MemberMedicalhistory memberMedicalhistory) {
        return mapper.insertMemberMedicalhistory(memberMedicalhistory);
    }

    public int deleteMemberEssentialinfoService(String member_id) {
        return mapper.deleteMemberEssentialinfo(member_id);
    }

    public int updateMemberEssentialinfoService(Memberfiles memberfiles) {
        return mapper.updateMemberEssentialinfo(memberfiles);
    }

//    public Memberfiles queryByConditionService(String condition) {
//        return mapper.queryByCondition(condition);
//    }

    public PageInfo<Memberfiles> queryEssentialinfoListService(PageVo pageVo) {
        PageHelper.startPage(pageVo.getCurrentPage(),pageVo.getPageSize());
        List<Memberfiles> byPagination = mapper.queryEssentialinfoList((Memberfiles) pageVo.getEntity());
        PageInfo<Memberfiles> pageInfo = new PageInfo<Memberfiles>(byPagination);
        return pageInfo;
    }

    public List<Memberfiles> queryEssentialinfoAllService() {
        return mapper.queryEssentialinfoAll();
    }


    public List<String> memberidService() {
        return mapper.memberid();
    }
}
